//
//  CartHomeViewController.m
//  much
//
//  Created by weijunjie on 2019/1/4.
//  Copyright © 2019年 iOS. All rights reserved.
//

#import "CartHomeViewController.h"

@interface CartHomeViewController () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UILabel *navigationRightLabel;
@end

@implementation CartHomeViewController

- (void)_reLayout {
    [self setupNavigationItems];
    
    // 获取购物车列表
}

- (void)setupNavigationItems {
    
    self.navigationView.titleLabel.text = @"购物车";
    __weakConfigure
    [self.navigationView addCustomView:self.navigationRightLabel makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(__weakSelf.navigationView).offset(-15);
        make.bottom.equalTo(__weakSelf.navigationView);
        make.height.mas_equalTo(44);
    } callback:^(UIView *view) {
        
    }];
}

#pragma mark - 懒加载
- (UILabel *)navigationRightLabel {
    if (!_navigationRightLabel) {
        _navigationRightLabel = [[UILabel alloc] init];
        _navigationRightLabel.font = APPFONT(14);
        _navigationRightLabel.textColor = Color80;
        _navigationRightLabel.text = @"编辑";
    }
    return _navigationRightLabel;
}

- (UITableView *) tableView {
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
        _tableView.backgroundColor = Color244;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.estimatedRowHeight = 0;
        _tableView.estimatedSectionHeaderHeight = 0;
        _tableView.estimatedSectionFooterHeight = 0;
        _tableView.delegate = self;
        _tableView.dataSource = self;
        
        [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self.view);
            make.top.equalTo(self.navigationView.mas_bottom);
            make.bottom.equalTo(self.view);
        }];
    }
    return _tableView;
}

#pragma mark - request

@end
